

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script type="text/javascript" src="helpman_topicinit.js"></script>

<title>Java  [Enterprise Architect User Guide]</title>

<meta name="keywords" content="Enterprise Architect, Sparx Systems, UML, Debug Session,Debug Session Java Setup,Debug Session Set Up For Java,Java,Java Set Up Debug Session">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
  A, A:Visited
  {
    color: #00F;
  }

  A:Active, A:Hover
  {
    color: #F00;
  }

  OL
  {
    margin: 5px 0 5px 48px;
  }

  UL
  {
    margin-bottom: 3px;
    margin-top: 0;
  }

  #nsr
  {
    background-color: #D4DFFF;
  }

  #nsr A
  {
    text-decoration: none;
  }

  #mainbody
  {
    padding: 8px;
  }

  .p_BodyText
  {
    padding: 5px 0;
  }
</style>



<style type="text/css" media="screen">
  BODY
  {
    background-color: #FFFFFF;
  }

  #nsr
  {
    padding: 6px 6px 0 6px;
    border-bottom: none;
    vertical-align: top;
    z-index: 2;
    visibility: visible;
    left: 0;
    top: 0;
    position: absolute;
  }

  #mainbody
  {
    left: 0;
    top: 0;
    margin: 0;
    position: absolute;
    padding: 10px;
    overflow: auto;
    height: 100%;
    z-index: 1;
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
  }
</style>

<style type="text/css" media="print">
  #nsr
  {
    visibility: none;
  }

  #mainbody
  {
    overflow: visible;
  }
</style>
<script type="text/javascript" language="JavaScript" src="nonscroll.js"></script>

</head>
<body scroll="no">

<div id="page">



        <div id="content">
          <div id="content-inner">
          



  
          <div id="nsr">
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
              <tr valign="top">
                <td align="left">
  


                  <p class="p_Heading1"><span class="f_Heading1">Java</span></p>



  
                </td>
                <td align="right">
                  <a href="introduction.htm" onmouseover="document.images.main.src='button_main_h.gif'" onmouseout="document.images.main.src='button_main.gif'">
                    <img name="main" src="button_main.gif" border=0 alt="Return to Introduction">
                  </a>&nbsp;
    
                  <a href="microsoft_native.htm" onmouseover="document.images.prev.src='button_prev_h.gif'" onmouseout="document.images.prev.src='button_prev.gif'">
                    <img name=prev src="button_prev.gif" border=0 alt="Previous page" />
                  </a>&nbsp;
    
    
    
                  <a href="attach_to_vm.htm" onmouseover="document.images.next.src='button_next_h.gif'" onmouseout="document.images.next.src='button_next.gif'">
                    <img name=next src="button_next.gif" border=0 alt="Next page" />
                  </a>
    
    
                </td>
              </tr>
            </table>
          </div>
          <div id="mainbody">
  


                <p class="p_TextIndentedL2"><img src="debug_java_c.png" width="683" height="390" border="0" alt="debug_java_c"><br>
<span class="f_TextIndentedL2">&nbsp;</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="0" border="0" style="border: none; border-spacing:0px; border-collapse: collapse;">
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="210" bgcolor="#e3e6ed" style="width:210px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Option</span></p>
</td>
<td valign="top" width="589" bgcolor="#e3e6ed" style="width:589px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Use to</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="210" style="width:210px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Application (Enter path)</span></p>
</td>
<td valign="top" width="589" style="width:589px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Identify the fully qualified Class name to debug, followed by any arguments. The Class must have a method declared with the following signature:</span></p>
<p class="p_CodeExample" style="margin: 0px 0px 0px 30px;"><span class="f_Code">public&nbsp;static&nbsp;void&nbsp;main(String[]);</span></p>
<p class="p_Tabletext"><span class="f_Tabletext">The debugger calls this method on the Class you name. In the example above, the parameters</span><span class="f_MenuKeyField"> 1</span><span class="f_Tabletext">, </span><span class="f_MenuKeyField">2</span><span class="f_Tabletext"> and </span><span class="f_MenuKeyField">3</span><span class="f_Tabletext"> are passed to the method.</span></p>
<p class="p_Tabletext"><span class="f_Tabletext">You can also debug a Java application by <a href="attach_to_vm.htm">attaching to an existing Java process</a>.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="210" style="width:210px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Enter any run time variables below</span></p>
</td>
<td valign="top" width="589" style="width:589px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Type any required command line options to the Java Virtual Machine.</span></p>
<p class="p_Tabletext"><span class="f_Tabletext">You also must provide a parameter (</span><span class="f_Tabletext" style="font-weight: bold;">jre</span><span class="f_Tabletext">) that is a path to be searched for the </span><span class="f_Tabletext">jvm.dll. </span><span class="f_Tabletext">This is the DLL supplied as part of the Java runtime environment or Java JDK from Sun Microsystems</span><span class="f_Tabletext" style="font-size: 6pt; vertical-align: super;">TM</span><span class="f_Tabletext"> (see <a href="debuggingwithea.htm">Debugging</a>).</span></p>
<p class="p_Tabletext"><span class="f_Tabletext">In the example above, a virtual machine is created with a new Class path property that comprises any paths named in the environment variable </span><span class="f_Tabletext" style="font-style: italic;">classpath 1603</span><span class="f_Tabletext"> plus the single path </span><span class="f_Code">&quot;C:\benchmark\java\example1&quot;</span><span class="f_Tabletext">.</span></p>
<p class="p_Tabletext"><span class="f_Tabletext">If no Class path is specified, the debugger always creates the virtual machine with a Class path property equal to any path contained in the environment variable plus the path entered in the default working directory of this script.</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 4px 2px 4px 2px;"><table cellspacing="0" cellpadding="2" border="0" style="border: none; border-spacing:0px;">
<tr style="text-align:left;vertical-align:bottom;">
<td valign="bottom" width="612" bgcolor="#efeff7" style="width:612px; background-color:#efeff7;"><p class="p_TiporNote" style="border-top: none; border-right: none; border-left: none;"><span class="f_TiporNote">Note:</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td width="612" bgcolor="#f7f7ff" style="width:612px; background-color:#f7f7ff;"><p class="p_TiporNoteText"><span class="f_TiporNoteText">If source files and .class files are located under different directory trees, the Class path property MUST include both root path(s) to the source and root path(s) to binary class files.</span></p>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="210" style="width:210px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Show Console</span></p>
</td>
<td valign="top" width="589" style="width:589px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Create a console window for Java. If no console window is required, leave blank.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="210" style="width:210px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext" style="font-weight: bold;">Use Debugger</span></p>
</td>
<td valign="top" width="589" style="width:589px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Select </span><span class="f_MenuKeyField">Java</span><span class="f_Tabletext">.</span></p>
</td>
</tr>
</table>
</div>




            </div>
          </div>
        </div>



</div>


</body>
</html>
